3.1.7 \(\int \frac {\csc (x)}{a-a \cos ^2(x)} \, dx\) [7]

Optimal. Leaf size=22 \[ -\frac {\tanh ^{-1}(\cos (x))}{2 a}-\frac {\cot (x) \csc (x)}{2 a} \]

[Out]

-1/2*arctanh(cos(x))/a-1/2*cot(x)*csc(x)/a

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3254, 3853, 3855} \begin {gather*} -\frac {\tanh ^{-1}(\cos (x))}{2 a}-\frac {\cot (x) \csc (x)}{2 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[x]/(a - a*Cos[x]^2),x]

[Out]

-1/2*ArcTanh[Cos[x]]/a - (Cot[x]*Csc[x])/(2*a)

Rule 3254

Int[(u_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Dist[a^p, Int[ActivateTrig[u*cos[e + f*x
]^(2*p)], x], x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0] && IntegerQ[p]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\csc (x)}{a-a \cos ^2(x)} \, dx &=\frac {\int \csc ^3(x) \, dx}{a}\\ &=-\frac {\cot (x) \csc (x)}{2 a}+\frac {\int \csc (x) \, dx}{2 a}\\ &=-\frac {\tanh ^{-1}(\cos (x))}{2 a}-\frac {\cot (x) \csc (x)}{2 a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(51\) vs. \(2(22)=44\).
time = 0.01, size = 51, normalized size = 2.32 \begin {gather*} \frac {-\frac {1}{8} \csc ^2\left (\frac {x}{2}\right )-\frac {1}{2} \log \left (\cos \left (\frac {x}{2}\right )\right )+\frac {1}{2} \log \left (\sin \left (\frac {x}{2}\right )\right )+\frac {1}{8} \sec ^2\left (\frac {x}{2}\right )}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]/(a - a*Cos[x]^2),x]

[Out]

(-1/8*Csc[x/2]^2 - Log[Cos[x/2]]/2 + Log[Sin[x/2]]/2 + Sec[x/2]^2/8)/a

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 36, normalized size = 1.64

method result size
default \(\frac {\frac {1}{4 \cos \left (x \right )+4}-\frac {\ln \left (\cos \left (x \right )+1\right )}{4}+\frac {1}{-4+4 \cos \left (x \right )}+\frac {\ln \left (-1+\cos \left (x \right )\right )}{4}}{a}\) \(36\)
norman \(\frac {-\frac {1}{8 a}+\frac {\tan ^{4}\left (\frac {x}{2}\right )}{8 a}}{\tan \left (\frac {x}{2}\right )^{2}}+\frac {\ln \left (\tan \left (\frac {x}{2}\right )\right )}{2 a}\) \(36\)
risch \(\frac {{\mathrm e}^{3 i x}+{\mathrm e}^{i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2} a}-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{2 a}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{2 a}\) \(52\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)/(a-a*cos(x)^2),x,method=_RETURNVERBOSE)

[Out]

1/a*(1/4/(cos(x)+1)-1/4*ln(cos(x)+1)+1/4/(-1+cos(x))+1/4*ln(-1+cos(x)))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 37 vs. \(2 (18) = 36\).
time = 0.27, size = 37, normalized size = 1.68 \begin {gather*} \frac {\cos \left (x\right )}{2 \, {\left (a \cos \left (x\right )^{2} - a\right )}} - \frac {\log \left (\cos \left (x\right ) + 1\right )}{4 \, a} + \frac {\log \left (\cos \left (x\right ) - 1\right )}{4 \, a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a-a*cos(x)^2),x, algorithm="maxima")

[Out]

1/2*cos(x)/(a*cos(x)^2 - a) - 1/4*log(cos(x) + 1)/a + 1/4*log(cos(x) - 1)/a

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 48 vs. \(2 (18) = 36\).
time = 0.38, size = 48, normalized size = 2.18 \begin {gather*} -\frac {{\left (\cos \left (x\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left (\cos \left (x\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - 2 \, \cos \left (x\right )}{4 \, {\left (a \cos \left (x\right )^{2} - a\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a-a*cos(x)^2),x, algorithm="fricas")

[Out]

-1/4*((cos(x)^2 - 1)*log(1/2*cos(x) + 1/2) - (cos(x)^2 - 1)*log(-1/2*cos(x) + 1/2) - 2*cos(x))/(a*cos(x)^2 - a
)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {\int \frac {\csc {\left (x \right )}}{\cos ^{2}{\left (x \right )} - 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a-a*cos(x)**2),x)

[Out]

-Integral(csc(x)/(cos(x)**2 - 1), x)/a

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 38 vs. \(2 (18) = 36\).
time = 0.41, size = 38, normalized size = 1.73 \begin {gather*} -\frac {\log \left (\cos \left (x\right ) + 1\right )}{4 \, a} + \frac {\log \left (-\cos \left (x\right ) + 1\right )}{4 \, a} + \frac {\cos \left (x\right )}{2 \, {\left (\cos \left (x\right )^{2} - 1\right )} a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a-a*cos(x)^2),x, algorithm="giac")

[Out]

-1/4*log(cos(x) + 1)/a + 1/4*log(-cos(x) + 1)/a + 1/2*cos(x)/((cos(x)^2 - 1)*a)

________________________________________________________________________________________

Mupad [B]
time = 0.08, size = 26, normalized size = 1.18 \begin {gather*} -\frac {\cos \left (x\right )}{2\,\left (a-a\,{\cos \left (x\right )}^2\right )}-\frac {\mathrm {atanh}\left (\cos \left (x\right )\right )}{2\,a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(x)*(a - a*cos(x)^2)),x)

[Out]

- cos(x)/(2*(a - a*cos(x)^2)) - atanh(cos(x))/(2*a)

________________________________________________________________________________________